package com.cj.DesignMode.factory;

/**
 * @author chan
 * @dateTime 2022/7/18  10:57:10
 */
public class ShapeFactory {
    public Shape getShape(String type) {
        if (type == null) {
            return null;
        }
        if("Circle".equals(type)){
            return new Circle();
        }
        if("Rectangle".equals(type)){
            return new Rectangle();
        }
        if("Square".equals(type)){
            return new Square();
        }
        return null;
    }
}
